var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("GlobalParams"),
    i = e("CommonHelper"),
    r = e("RoleSoldierInfo"),
    s = cc._decorator,
    l = s.ccclass,
    c = s.property,
    d = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.skill_name = null),
                (t.skill_info = null),
                (t.dower_now_num = null),
                (t.dower_level = null),
                (t.skill_node = null),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.initView = function () {
                this.showChooseDower(), this.showDowerInfo(0);
            }),
            (t.prototype.OnClick = function (t) {
                e.prototype.OnClick.call(this, t);
                var o = t.node.name;
                switch (o) {
                    case "skill_0":
                    case "skill_1":
                    case "skill_2":
                    case "skill_3":
                    case "skill_4":
                    case "skill_5":
                        var n = Number(i.default.getNameType(o, "skill_"));
                        this.showDowerInfo(n);
                }
            }),
            (t.prototype.showDowerInfo = function (e) {
                var t = r.default.Dower_info[e];
                (this.skill_name.string = t.spirit_name), (this.skill_info.string = t.spirit_des);
                var o = a.GlobalParams.PlayerDowerInfo.value.dower[e];
                (this.dower_level.string = o + "级"),
                    (this.dower_now_num.string = "" + t.spirit_int[o]),
                    (a.GlobalParams.MatchGamePlayer[a.GlobalParams.MatchMyIndex].dower_info = [e, t.spirit_int[o]]),
                    this.showChooseDower();
            }),
            (t.prototype.showChooseDower = function () {
                for (var e = 0; e < 5; e++)
                    this.skill_node.children[e].children[0].active =
                        a.GlobalParams.MatchGamePlayer[a.GlobalParams.MatchMyIndex].dower_info[0] == e;
            }),
            __decorate([c(cc.Label)], t.prototype, "skill_name", void 0),
            __decorate([c(cc.Label)], t.prototype, "skill_info", void 0),
            __decorate([c(cc.Label)], t.prototype, "dower_now_num", void 0),
            __decorate([c(cc.Label)], t.prototype, "dower_level", void 0),
            __decorate([c(cc.Node)], t.prototype, "skill_node", void 0),
            __decorate([l], t)
        );
    })(n.default);
o.default = d;
